The present disclosure relates to a sewing machine and a computer-readable storage medium storing a program that controls the sewing machine and, more particularly, to a sewing machine equipped with an image pickup device and a computer-readable storage medium storing a control program that controls the sewing machine.
Conventionally, for a variety of purposes, a sewing machine has been proposed which is equipped with an image pickup device. For example, in an embroidery data modification apparatus described in Japanese Patent Application Laid-Open Publication No. HEI 4-364884, an electronic camera is equipped on a sewing machine that performs sewing based on embroidery data. An image photographed with the electronic camera is utilized to modify the location of a needle drop point for a stitch in accordance with actual sewing results. Generally, in the case of acquiring and utilizing the location (coordinates) of a photography subject by an image photographed with a camera as in the case of measurement by use of an air photo, the camera will be calibrated in order to grasp a precise location of the photography subject based on the image. Camera calibration involves the calculation of an internal parameter which is determined by a configuration of the camera such as a focal distance or a principal point coordinate and an external parameter which is determined by a condition in which the camera is set up such as its photographing direction. With the parameters calculated through camera calibration, it is possible to know a location in a two-dimensional coordinate system (photographed image) at which a point (real photography subject) in a three-dimensional coordinate system should be projected. Therefore, if a point in the photographed image is projected precisely with the parameters, a precise location (coordinates) of that point becomes clear. Thus, by carrying out camera calibration, it is possible to correct strain in picked-up images which is caused by properties of the camera itself or a condition in which the camera is set up. How to perform camera calibration (calculate the parameters) has been studied variously, resulting in the proposal of, for example, an automatic calibration apparatus for a visual sensor described in Japanese Patent Application Laid-Open Publication No. 3138080.